import checkShowPage from '@/utils/checkShowPage';

// 页面白名单
const whiteList = ['/pages/login/login'];

// 登录页
const loginPage = '/pages/login/login';

// 检查地址白名单
const checkWhite = (url) => {
  const path = url.split('?')[0];
  return whiteList.indexOf(path) !== -1;
};

const checkStart = (url) => {
  if (!getToken() && !checkWhite(url)) {
    tab.reLaunch(loginPage);
    return false;
  } else {
    return true;
  }
};

export default {
  whiteList,
  loginPage,
  checkStart,
  checkWhite,
};
